using System;
using UnityEngine;

namespace CinemaDirector
{
	[Serializable]
	public class Rotation
	{
		public enum AngleType
		{
			LocalValue = 0,
			Current = 1
		}

		public AngleType angleType;

		public Vector3 euler;

		[NonSerialized]
		public Vector3 currentLocalEuler;

		public void SetLocal(Transform trans)
		{
			angleType = AngleType.LocalValue;
			euler = trans.localRotation.eulerAngles;
		}

		public void SetCurrent(Transform transform)
		{
			currentLocalEuler = transform.localRotation.eulerAngles;
		}

		public Vector3 GetLocalEuler(Transform transform)
		{
			if (angleType == AngleType.Current)
			{
				return currentLocalEuler;
			}
			return euler;
		}
	}
}
